@import url(https://fonts.googleapis.com/css?family=Lato);

* {
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  height: 100vh;
  justify-content: center;
  align-items: center;
  background: #1A1E23;
}

.btn {
  position: relative;
  padding: 1rem 3rem;
  font-size: 1rem;
  line-height: 1.5;
  color: white;
  text-transform: uppercase;
  background-color: transparent;
  border: 1px solid hsl(76, 76%, 42%);
  // 关键
  overflow: hidden; 
  cursor: pointer;
  user-select: none;
  transition: 0.25s;

  &-shine {
    &::before {
      position: absolute;
      content: "";
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(
        120deg,
        transparent,
        hsla(76, 84%, 64%, 0.5),
        transparent
      );
      transform: translateX(-100%);
      transition: 0.6s;
    }

    &:hover {
      color: hsl(160, 63%, 54%);
      box-shadow: 0 0 20px 10px hsla(103, 57%, 47%, 0.5);
    }

    &:hover::before {
      transform: translateX(100%);
    }
  }
}
